1. Field of the Invention
This invention relates generally to computer I/O subsystems having expanders, and more particularly to methods for discovering topology of I/O subsystems including peripheral devices and expanders.
2. Description of the Related Art
Modem computer systems often utilize one or more buses to connect to peripheral devices to enhance its resources. For example, the resources of a computer system may be substantially increased by connecting the computer system to one or more peripheral devices such as disk drives, tape drives, printers, scanners, optical drives, and the like. These peripheral devices are attached to the computer system by means of a peripheral bus (e.g., cable).
One of the most widely used peripheral buses is the well known small computer systems interface (SCSI) bus, which is defined in conformity with well known SCSI protocols (e.g., SCSI-1, SCSI-2, SCSI-3, etc.), which are incorporated herein by reference. The SCSI protocols are designed to provide an efficient peer-to-peer I/O interface between a host computer and its peripheral devices in a computer system.
FIG. 1 shows a block diagram of a conventional computer system 100 including a host computer 102, a plurality of SCSI devices 106, and a SCSI bus 108. The host computer 102 includes a SCSI host adapter 104 for communicating with the SCSI devices 106. The host adapter 104 in the computer system 100 controls communication between the host computer 102 and the SCSI devices 106. For example, the host adapter 104 provides a physical connection between the host computer 102 and the SCSI bus 108. In addition, it is configured to receive data, address, and control signals from the host computer 102 and convert the signals into corresponding SCSI compatible data, address, and control signals. Conversely, the SCSI host adapter 104 is also configured to receive SCSI compatible data, address, and control signals from the SCSI devices 106 through the SCSI bus 108 and convert them into corresponding host-bus compatible data, addressing, and control signals. The SCSI host adapter 104 is well known in the art and may be implemented, for example, by using AIC-7890A(trademark) packaged semiconductor device, which is available from Adaptec Inc., of Milpitas, Calif.
Under the conventional SCSI specifications, the SCSI bus 108 may connect up to 16 SCSI devices including the host adapter 104 depending on the type of SCSI bus implemented. The SCSI devices 106 may be peripheral devices such as disk drives, tape drives, printers, scanners, optical drives, or any other devices that meet the SCSI specification. The SCSI bus 108 is typically implemented as a cable having a set of parallel wires. For example, the SCSI-1 cable has 50 wires. Of these 50 wires, eight wires are for data, one wire is for parity, nine wires are for control, 25 wires are for ground, and the remaining wires are for power or are reserved for future use. The eight data wires are used to carry eight bits of data in parallel. In general, conventional SCSI bus cables include either 8 or 16 data wires for carrying 8 or 16 bits, respectively, of data in parallel. The data wires in the bus thus define a datapath for communicating bits equal to the number of data wires in the bus.
A traditional SCSI bus may accommodate a plurality of SCSI devices up to a maximum number equal to the number of data bits in the SCSI bus. In practice, the width of the SCSI datapath is typically 8 or 16 bits corresponding to the number of data wires in the SCSI bus. This means the maximum number of SCSI devices, including a host adapter, that can be attached to a SCSI bus is limited to 8 or 16.
Conventional SCSI buses, however, are generally capable of transmitting signals reliably for a specified cable length only. For example, SCSI bus cables conforming to SCSI specifications are typically limited to a maximum length such as 3, 6, 12, or 25 meters, and the like. In modern computer systems such as servers that need to communicate with numerous SCSI devices, some SCSI peripheral devices may be located more than the specified cable length away from a host computer.
In such instances, an expander, which is essentially a repeater, is typically used to add another SCSI bus, which is then used to couple additional SCSI devices. FIG. 2 illustrates a conventional computer system 200 that includes an expander 214 for connecting a pair of SCSI buses 208 and 210. In the computer system 200, a host computer 202 is coupled to the SCSI bus 208 via a SCSI host adapter 204. One or more SCSI devices 206 are coupled to the SCSI bus 208 while one or more SCSI devices 212 are coupled to the SCSI bus 210. The expander 214 is coupled between the SCSI buses 208 and 210 to regenerate signals received on either SCSI bus 208 or 210 for transmission to the other SCSI bus. In this configuration, the expander 214 functions to extend the length of the overall SCSI bus so that additional SCSI devices 212 or expanders can be attached to the SCSI bus 210. The SCSI devices 212 and SCSI bus 210 are collectively referred to as a segment. Similarly, the host adapter 204, SCSI devices 208, and SCSI bus 210 collectively define another segment.
Conventional expanders, however, are typically transparent devices without SCSI IDs of their own. This means that the expanders are not addressable and are thus invisible to SCSI protocol. Using such transparent expanders without dedicated SCSI IDs in an I/O subsystem presents several drawbacks. For example, individual segments of the I/O subsystem often need to be modified to isolate faulty cables, connections, drivers, and receivers. In addition, it is often desirable to communicate with individual expanders to determine optimum speed at which the expanders can communicate during domain validation.
Because conventional expanders are not addressable, these modifications and domain validation processes may not be easily performed automatically without a system administrator. In addition, a host computer typically needs to know the topology or map of the entire I/O subsystem before performing the modifications and domain validation processes. One obvious solution would be to implement expanders like SCSI devices by adding SCSI controllers and assigning SCSI IDs used for SCSI devices. This solution, however, would reduce the number of addressable SCSI devices that can be attached to a SCSI I/O subsystem. Further, assigning SCSI addresses to expanders will typically require system administrators to keep track of SCSI IDs of all individual expanders and manually set the jumpers for the expander IDs. In a complex I/O subsystem with substantial number of SCSI devices and expanders, assigning SCSI IDs to expanders by manually setting the jumpers may be complicated and labor intensive.
In view of the foregoing, what is needed is a method for automatically discovering topology map of I/O subsystems that use expanders to extend the length of a SCSI bus without using valuable conventional SCSI IDs.
The present invention fills these needs by providing methods for discovering topology map of an I/O subsystem. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, a device, a method, or a computer readable medium. Several inventive embodiments of the present invention are described below.
In one embodiment, the present invention provides a method for automatically discovering topology map of an I/O subsystem. The I/O subsystem is coupled to one or more host computers and includes one or more peripheral buses, a set of peripheral devices, and a set of expanders with each expander having a valid expander address and being arranged to couple a pair of the peripheral buses. The peripheral devices and the one or more host computers are coupled to the peripheral buses. A host computer selects a peripheral device as a target device and writes a set of entries to the selected target device. Each entry written contains an expander address field initialized to an invalid expander address for storing an expander address. The host computer then selects the target device and reads the set of entries from the target device. For each expander coupled between the host computer and the target device, the valid expander address associated with the each expander is written to or replaced by one of the expander address fields in the set of entries that contain invalid expander addresses. The host computer receives the set of entries such that the set of the valid expander addresses in the set of entries indicates identity of associated expanders coupled between the host computer and the target device. These operations are repeated for each of the other peripheral devices as the target device so as to discover the topology map of the entire I/O subsystem.
In another embodiment, the present invention provides a method for automatically discovering topology map of a SCSI I/O subsystem. The SCSI I/O subsystem is coupled to one or more host computers and includes one or more SCSI buses, a set of SCSI devices, and a set of expanders with each expander having a valid expander address and being arranged to couple a pair of the SCSI buses. The SCSI devices and the one or more host computers are coupled to the SCSI buses. In this method, a host computer selects a SCSI device as a target device and writes a set of entries to the selected target device. Each entry has an expander address field that is initialized to an invalid expander address for storing an expander address. Then, the host computer selects the target device and reads the set of entries from the target device. For each expander coupled between the host computer and the target device, the expander addresses in each of the entries is read and the valid expander address associated with the each expander is written into one of the expander address fields in the set of entries that contain invalid expander addresses. The host computer receives the set of entries that contain a set of the valid expander addresses. The received set of the valid expander addresses in the set of entries indicates identity of associated expanders coupled between the host computer and the target device. These operations are repeated for each of the other SCSI devices as the target device such that the sets of entries specify the topology map of the I/O subsystem.
Advantageously, the methods of the present invention allow topology mapping of I/O subsystems that use expanders to allow an in-line peripheral bus to run for greater lengths with branches. The I/O topology mapping is useful, for example, in domain validation, where expanders are addressed to determine their capabilities. In addition, the expander addressing scheme of the present invention allows significant flexibility in adding expanders without using conventional one-bit SCSI device IDs. Accordingly, the number of addressable legacy SCSI devices that can be attached to an I/O subsystem is not reduced by the use of expanders. Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.